<?php
/**@package     Joomla.Site
 * @subpackage  mod_booking
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt*/
defined('_JEXEC') or die;
$type   = $params->get('type', 0);
if($type==0){
?>
<script type="text/javascript" src="templates/protostar/js/jquery-1.7.1.min.js"></script>

<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>

<div id="map_canvas" style=""><div id="map"><span style="color:Gray;">Loading map...</span></div></div><!-- Map Ends display -->		
<script type="text/javascript">
var locations = [
//1
['<div class=info><h4>WMC Tower</h4><img src=http://wmctower.com/office/templates/myfair/images/logo.png><div class="contentmap">102A-B-C Cong Quynh Street, Pham Ngu Lao Ward, District 1, HCMC</div></div>', 10.765064, 106.690811],
['<div class=info><h4>Notre Dame Cathedral</h4><img src=http://www.windsorplazahotel.com/emarketing/various/img_duc_ba_church.jpg><div class="contentmap">Han Thuyen, facing down Dong Khoi</div></div>', 10.779786,106.698994],
['<div class=info><h4>Reunification Place</h4><img src=http://www.windsorplazahotel.com/emarketing/various/img_dinh_doc_lap.jpg><div class="contentmap">135 Nam Ki Khoi Nghia, Dist 1, HCMC<br>Tel: (848) 3822 3652<br>Fax: (848) 0808 5066</div></div>', 10.777123,106.695457],
['<div class=info><h4>Ho Chi Minh City Post Office</h4><img src=http://www.windsorplazahotel.com/emarketing/various/img_hcmc_post_office.jpg><div class="contentmap">125 Hai Ba Trung, Dist 1, HCMC<br>Tel: (848) 3828 2828<br>Fax: ( 848) 3824 2628</div></div>', 10.779487,106.699987],
['<div class=info><h4>War Remnants Museum</h4><img src=http://www.windsorplazahotel.com/emarketing/various/img_war_museum.jpg><div class="contentmap">28 Vo Van Tan, Dist 1, HCMC<br>Tel: (848) 3930 6325</div></div>', 10.779422,106.692073],
//6
['<div class=info><h4>People&acute;s Committee Hall</h4><img src=http://www.windsorplazahotel.com/emarketing/various/img_ubnd_tphcm.jpg><div class="contentmap">86 Le Thanh Ton, Dist 1, HCMC<br>Tel: (848) 3829 1054</div></div>', 10.7756965,106.7003131],
['<div class=info><h4>The International Primary School</h4><div class="contentmap introtext">21 Ngo Thoi Nhiem, Dist 1, HCMC</div></div>', 10.779716,106.704326],
 ['<div class=info><h4>Stamford Grammar SLC Kindergarten</h4><div class="contentmap introtext">214 Nam Ky Khoi Nghia</div></div>', 10.7833218,106.6915262],
['<div class=info><h4>Singapore International School & Kinderworld International</h4><div class="contentmap introtext">44 Truong Dinh, Dist 3, HCMC</div></div>', 10.7806079,106.686446],
['<div class=info><h4>Saigon Kids</h4><div class="contentmap introtext">104a Tran Quoc Toan, Dist 3, HCMC</div></div>', 10.784846,106.686444],
//11
['<div class=info><h4>ABC International School</h4><div class="contentmap introtext">28 Truong Dinh, Dist 3,HCMC</div></div>', 10.7789795,106.6883719],
['<div class=info><h4>Diamond Plaza</h4><div class="contentmap introtext">34 Le Duan, Dist 1, HCMC</div></div>', 10.781253,106.698668],
['<div class=info><h4>Co.op Mart</h4><div class="contentmap introtext">168 Nguyen Dinh Chieu, Dist 3, HCMC</div></div>', 10.780359,106.6917735],
['<div class=info><h4>Ben Thanh Market</h4><div class="contentmap introtext">Le Loi, Dist 1, HCMC</div></div>', 10.7725662,106.6979917],
['<div class=info><h4>Located in the Pham Ngu Lao</h4><div class="contentmap introtext">Pham Ngu Lao Street, Dist 1, HCMC</div></div>', 10.767644, 106.690773],
//16
['<div class=info><h4>Nguyen Hue Boulevard</h4><div class="contentmap introtext">78 Nguyen Hue, Dist 1, HCMC</div></div>', 10.774847, 106.702824],
['<div class=info><h4>Zen Plaza Shopping Center</h4><div class="contentmap introtext">49 Nguyen Trai, Dist 1, HCMC</div></div>', 10.770525, 106.692128],
['<div class=info><h4>Now Zone Shopping Center</h4><div class="contentmap introtext">235 Nguyen Van Cu, Dist 1, HCMC</div></div>', 10.764283, 106.682792],
['<div class=info><h4>Parkson Saigontourist Plaza</h4><div class="contentmap introtext">28 Le Thanh Ton, Dist 1, HCMC</div></div>', 10.7794381,106.7037517],
['<div class=info><h4>Vincom Center Shopping Mall</h4><div class="contentmap introtext">66 Le Thanh Ton, Dist 1, HCMC</div></div>', 10.7781548,106.7019344],
//21
['<div class=info><h4>Saigon Tax Center</h4><div class="contentmap introtext">135 Nguyen Hue, Dist 1, HCMC</div></div>', 10.774901,106.702109],
['<div class=info><h4>Galaxy Cinema</h4><div class="contentmap introtext">116 Nguyen Du, Dist 1, HCMC</div></div>', 10.772962,106.693704],
['<div class=info><h4>September 23rd Park</h4><div class="contentmap introtext"> Le Lai, Pham Ngu Lao, Dist 1, HCMC</div></div>', 10.769475, 106.693398],
['<div class=info><h4>Le Van Tam Park</h4><div class="contentmap introtext">Vo Thi Sau and Hai Ba Trung, Dist 3, HCMC</div></div>', 10.7880937,106.6936908],
['<div class=info><h4>April 30th Park</h4><div class="contentmap introtext">Le Duan and Pasteur, Dist 1, HCMC</div></div>', 10.7791832,106.6972834],
//26
['<div class=info><h4>Tao Dan Park</h4><div class="contentmap introtext">55C Nguyen Thi Minh Khai, Dist 3, HCMC</div></div>', 10.7743726,106.6925157],
['<div class=info><h4>Saigon Opera House</h4><div class="contentmap introtext">7 Lam Son Square, Dist 1, HCMC</div></div>', 10.77699,106.703481],
['<div class=info><h4>Tan Son Nhat International Airport </h4><div class="contentmap introtext">Ward 2, Dist Tan Binh, HCMC</div></div>', 10.818763, 106.658868],
];
    // Setup the different icons and shadows
    var iconURLPrefix = 'http://wmctower.com/staging/templates/protostar/images/iconmap/';
    var icons = [  
	  iconURLPrefix + 'icon_mayfair.png',//1
       iconURLPrefix + 'cathedral2.png',//2
      iconURLPrefix + 'museum-war.png',//3
      iconURLPrefix + 'postal.png',//4
      iconURLPrefix + 'museum-war.png',//5
      iconURLPrefix + 'palace.png',     //6
      iconURLPrefix + 'school.png',//7
      iconURLPrefix + 'school.png',      //8
      iconURLPrefix + 'school.png',//9
      iconURLPrefix + 'school.png', //10     
      iconURLPrefix + 'school.png', //11    
      iconURLPrefix + 'shoppingmall.png',//12
      iconURLPrefix + 'supermarket.png', //13     
      iconURLPrefix + 'shoppingmall.png',//14
      iconURLPrefix + 'street.png',//15
	  iconURLPrefix + 'street.png',	//16	 
	  iconURLPrefix + 'shoppingmall.png',//17
	  iconURLPrefix + 'shoppingmall.png',//18	  
      iconURLPrefix + 'shoppingmall.png',//19
      iconURLPrefix + 'shoppingmall.png', //20  
	  iconURLPrefix + 'shoppingmall.png',	  
      iconURLPrefix + 'cinema.png',//21
	  iconURLPrefix + 'park.png',  //22
      iconURLPrefix + 'park.png', //23    
      iconURLPrefix + 'park.png',//24
      iconURLPrefix + 'park.png',  //25    
      iconURLPrefix + 'shoppingmall.png', //26
	  iconURLPrefix + 'airport.png',//27  
    ]
    var icons_length = icons.length;
    var shadow = {
      anchor: new google.maps.Point(5,13),
      url: iconURLPrefix + 'msmarker.shadow.png'
    };
    var map = new google.maps.Map(document.getElementById('map'), {
      zoom:17,
      center: new google.maps.LatLng(10.765022, 106.691078),
      mapTypeId: google.maps.MapTypeId.ROADMAP,
      mapTypeControl: false,
      streetViewControl: false,
	  disableDefaultUI: true,
      panControl: false,
	  zoomControl: true
      //zoomControlOptions: {position: google.maps.ControlPosition.LEFT_BOTTOM}
    });
    var infowindow = new google.maps.InfoWindow({
      maxWidth:745,
	  maxHeight:600
    });
    var marker;
    var markers = new Array();
    var iconCounter = 0;
    // Add the markers and infowindows to the map
    for (var i = 0; i < locations.length; i++) {  
      marker = new google.maps.Marker({
        position: new google.maps.LatLng(locations[i][1], locations[i][2], locations[i][3], locations[i][4], locations[i][5]),
        map: map,
        icon : icons[iconCounter],
        shadow: shadow
      });
      markers.push(marker);
      google.maps.event.addListener(marker, 'click', (function(marker, i) {
        return function() {
          infowindow.setContent(locations[i][0]);
          infowindow.open(map, marker);
        }
      })(marker, i));
      iconCounter++;
      if(iconCounter >= icons_length){
      	iconCounter = 0;
      }
    }
    function mapclick(sott){
		marker = new google.maps.Marker({
			position: new google.maps.LatLng(locations[sott][1],locations[sott][2]),
			map: map,
			icon : icons[sott],
			shadow: shadow
		});
		markers.push(marker);
		infowindow.setContent(locations[sott][0]);
		infowindow.open(map, marker);
    };
    function AutoCenter() {
		var bounds = new google.maps.LatLngBounds();
		$.each(markers, function (index, marker) { bounds.extend(marker.position);});
		map.fitBounds(bounds);
    }
    AutoCenter();
  </script> 
<?php
}
if($type==1){

}
?>